import React from 'react';
import { useParams, Link } from 'react-router-dom';
import { ArrowLeft, ArrowRight, Calendar, MapPin, User, ThumbsUp, MessageCircle, Share2, Bookmark, Tag } from 'lucide-react';
export function StoryDetail() {
  const {
    postId
  } = useParams();
  // This would normally come from an API or database
  // For this example, we're using hardcoded stories based on the ID
  const stories = {
    post1: {
      title: 'Winter Ascent of Mount Rainier: Gear That Saved My Life',
      excerpt: 'Facing unexpected whiteout conditions at 12,000ft, these pieces of gear proved their worth beyond any doubt.',
      content: `
        <p>It was supposed to be a routine winter ascent of Mount Rainier—something I'd done half a dozen times before. The forecast called for clear skies and moderate winds, perfect conditions for a quick two-day summit push. But as any experienced mountaineer knows, forecasts in alpine environments can be wildly unreliable.</p>
        <p>At 12,000 feet, everything changed. Within 30 minutes, visibility dropped from unlimited to less than 10 feet as we were engulfed in a whiteout that hadn't appeared on any forecast model. The temperature plummeted to -15°F with windchill likely pushing it below -30°F. What had been a straightforward ascent suddenly became a fight for survival.</p>
        <h2>When Technology Fails</h2>
        <p>The first casualty was technology. My smartphone shut down almost immediately in the extreme cold, despite being in an insulated pocket. My backup GPS device lasted longer but eventually succumbed to the conditions as well. This is when I realized how critical redundant navigation systems are in alpine environments.</p>
        <p>Thankfully, I had a compass and physical map in a waterproof case—tools that many modern climbers neglect in favor of electronic alternatives. These simple, reliable tools became my lifeline when everything else failed.</p>
        <h2>Shelter from the Storm</h2>
        <p>As conditions deteriorated, we needed to make a critical decision: continue to the summit, descend blindly, or hunker down and wait out the storm. With navigation compromised and the risk of falling into a crevasse high, we chose to deploy our emergency shelter.</p>
        <p>I've carried the Mountain Hardwear Direkt 2 tent for years, adding about 4 pounds to my pack that I'd often questioned. In those moments, as we hurriedly set it up in howling winds, I knew those 4 pounds were the best weight investment I'd ever made. The tent's geodesic design stood strong against gusts that must have exceeded 60 mph, while its reinforced pole structure prevented collapse under the rapidly accumulating snow.</p>
        <h2>The Sleeping System That Prevented Hypothermia</h2>
        <p>Once in the shelter, maintaining core temperature became the priority. My Western Mountaineering Kodiak MF sleeping bag, rated to -40°F, proved to be worth every penny of its premium price tag. While most down bags would have quickly lost loft and insulating properties in the humid conditions inside our emergency shelter, the water-resistant down maintained its thermal efficiency.</p>
        <p>Equally important was my Therm-a-Rest NeoAir XTherm sleeping pad. With an R-value of 6.9, it provided crucial insulation from the snow beneath us. The difference was dramatic—a climbing partner with a lower R-value pad (around 3.0) struggled significantly more with maintaining warmth throughout the night.</p>
        <h2>Hydration and Nutrition When It Matters Most</h2>
        <p>The MSR Reactor stove system was perhaps the MVP of the ordeal. Its enclosed design and pressure regulator allowed it to operate efficiently despite the extreme conditions. While other stove systems might struggle or fail entirely at high altitude and in high winds, the Reactor performed flawlessly, allowing us to melt snow for drinking water and prepare freeze-dried meals.</p>
        <p>For emergency nutrition, I had packed Expedition Foods freeze-dried meals, which require less water and cook time than many alternatives—a critical factor when fuel conservation is essential. The high caloric density (over 800 calories per package) provided the energy needed to maintain core temperature through the night.</p>
        <h2>Communication That Works When Phones Don't</h2>
        <p>With cell phones useless, my Garmin inReach Mini satellite communicator became our connection to the outside world. Its ability to send pre-programmed messages with minimal battery usage allowed us to notify emergency contacts of our situation and position without depleting the device's power. The tracking function also meant search and rescue would have our exact coordinates if the situation deteriorated further.</p>
        <h2>The Gear List That Saved Us</h2>
        <p>Here's the complete list of gear that proved essential during our 36-hour ordeal:</p>
        <ul>
          <li><strong>Navigation:</strong> Traditional compass and waterproof map</li>
          <li><strong>Shelter:</strong> Mountain Hardwear Direkt 2 four-season tent</li>
          <li><strong>Sleep System:</strong> Western Mountaineering Kodiak MF -40°F down sleeping bag</li>
          <li><strong>Insulation:</strong> Therm-a-Rest NeoAir XTherm sleeping pad (R-value 6.9)</li>
          <li><strong>Cooking:</strong> MSR Reactor stove system with 1.7L pot</li>
          <li><strong>Hydration:</strong> 2x Nalgene bottles with insulated sleeves</li>
          <li><strong>Nutrition:</strong> Expedition Foods high-calorie freeze-dried meals</li>
          <li><strong>Communication:</strong> Garmin inReach Mini satellite communicator</li>
          <li><strong>Illumination:</strong> Black Diamond Storm 500-R headlamp with lithium batteries</li>
          <li><strong>Emergency Shelter:</strong> SOL Emergency Bivvy (as backup)</li>
        </ul>
        <h2>Lessons Learned</h2>
        <p>This experience reinforced several critical lessons about gear selection for alpine environments:</p>
        <ol>
          <li><strong>Redundancy is essential</strong> - Always have backup navigation systems that don't rely on battery power or electronic components.</li>
          <li><strong>Weight savings can be dangerous</strong> - The trend toward ultralight gear has its place, but not at the expense of safety margins in potentially life-threatening conditions.</li>
          <li><strong>Test all gear in controlled adverse conditions</strong> before relying on it in real emergencies.</li>
          <li><strong>Quality matters</strong> - In critical gear categories (shelter, sleep system, emergency communication), investing in premium equipment can be the difference between life and death.</li>
          <li><strong>Battery-powered devices are vulnerable</strong> - Cold temperatures dramatically reduce battery life. Plan accordingly with extra batteries stored in insulated containers close to your body.</li>
        </ol>
        <p>After 36 hours, the storm finally broke, allowing us to safely descend. What began as a routine climb became a powerful reminder that in alpine environments, your gear choices can determine survival. I've since refined my gear selections even further, always asking the critical question: "If everything goes wrong, will this piece of equipment perform when my life depends on it?"</p>
      `,
      image: 'https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2000&q=80',
      author: 'Alex Honnold',
      authorImage: 'https://images.unsplash.com/photo-1548535537-3cfaf1fc327c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=100&q=80',
      authorBio: 'Professional climber and mountaineer with 15+ years of experience in alpine environments.',
      date: 'March 12, 2023',
      location: 'Mount Rainier, WA',
      likes: 248,
      comments: 42,
      tags: ['Winter Mountaineering', 'Emergency Gear', 'Alpine Climbing', 'Survival'],
      relatedStories: [{
        id: 'post3',
        title: 'Desert Survival: Testing Water Filters in the Mojave',
        image: 'https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=700&q=80'
      }, {
        id: 'post6',
        title: 'How My Tent Survived a Category 3 Storm in Iceland',
        image: 'https://images.unsplash.com/photo-1504280390367-361c6d9f38f4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=700&q=80'
      }]
    },
    post2: {
      title: 'Ultralight Thru-Hiking: My PCT Gear List Review',
      excerpt: "After completing the Pacific Crest Trail, here's my honest assessment of what gear worked, what failed, and what I'd choose differently next time.",
      content: `
        <p>After 2,650 miles from Mexico to Canada along the Pacific Crest Trail (PCT), I've put my gear through one of the most comprehensive tests possible. From the scorching deserts of Southern California to the snow-covered passes of the Sierra Nevada and the rain-soaked forests of the Pacific Northwest, my equipment faced every challenge imaginable.</p>
        <p>What follows is my honest assessment of what worked, what failed, and what I'd choose differently if I were to do it all again. My base weight started at 14.2 pounds but dropped to 12.8 by the end as I refined my system.</p>
        <h2>The Big Three: What Worked and What Didn't</h2>
        <h3>Shelter: Zpacks Duplex Tent (19.4 oz)</h3>
        <p><strong>Verdict: Exceptional</strong></p>
        <p>Despite its premium price tag, the Duplex proved to be worth every penny. It withstood desert windstorms, Sierra thunderstorms, and Washington downpours without a single leak or structural issue. The dual vestibules were perfect for storing wet gear, and the weight-to-space ratio is unmatched. After 5+ months of continuous use, it shows minimal wear and remains completely waterproof.</p>
        <p>The only drawback was condensation management in humid environments, but this is an issue with virtually all single-wall shelters. Strategic site selection helped mitigate this problem.</p>
        <h3>Sleep System: Enlightened Equipment Enigma 20°F Quilt (20.9 oz)</h3>
        <p><strong>Verdict: Excellent with Caveats</strong></p>
        <p>The Enigma was a joy for most of the trail—lightweight, compressible, and adequately warm for all but the coldest Sierra nights. The 950-fill down maintained its loft impressively well, even after months of compression.</p>
        <p>However, I underestimated how cold I sleep. There were about 10 nights where the temperature dropped below the quilt's comfort rating, forcing me to sleep in all my layers. If I were to do it again, I'd opt for the 10°F version despite the weight penalty.</p>
        <p>The pad attachment system was also finicky and often came undrafted at night, creating cold spots—a common issue with quilts that requires a learning curve to address.</p>
        <h3>Sleeping Pad: Therm-a-Rest NeoAir XLite (12 oz)</h3>
        <p><strong>Verdict: Failed</strong></p>
        <p>This was my biggest gear disappointment. While incredibly comfortable and warm for its weight, my XLite developed a slow leak around mile 700 that proved impossible to find and patch effectively. I replaced it with a Nemo Tensor Insulated, which proved more durable but slightly heavier.</p>
        <p>The crinkly noise of the XLite was also more annoying than I anticipated in crowded shelters and campsites. For future thru-hikes, I'd start with the Nemo Tensor despite the weight penalty.</p>
        <h2>Backpack: Gossamer Gear Mariposa 60 (30.5 oz)</h2>
        <p><strong>Verdict: Excellent</strong></p>
        <p>The Mariposa struck the perfect balance between weight, comfort, and durability. The external pocket configuration was ideal for thru-hiking—I could access snacks, water filtering equipment, and rain gear without opening my main compartment.</p>
        <p>Even with loads up to 35 pounds (during Sierra food carries), the pack remained comfortable. The removable frame allowed me to use the sit pad during breaks, a small but appreciated feature over thousands of miles.</p>
        <p>The only wear after 2,650 miles was some abrasion on the bottom and a small hole in the side pocket (easily repaired with Tenacious Tape). I'd choose this pack again without hesitation.</p>
        <h2>Clothing System: Minimalist But Effective</h2>
        <h3>Hiking Clothes</h3>
        <ul>
          <li><strong>Patagonia Capilene Cool Daily Hoody (3.7 oz)</strong> - Exceptional. The sun protection and odor resistance were outstanding. I'd buy three next time.</li>
          <li><strong>REI Sahara Convertible Pants (9.5 oz)</strong> - Good. Durable and functional, though I rarely used the zip-off feature.</li>
          <li><strong>ExOfficio Give-N-Go Boxer Briefs (2.0 oz)</strong> - Failed. Developed holes quickly. Replaced with Patagonia briefs mid-trail.</li>
          <li><strong>Darn Tough Hiker Micro Crew Socks (2.6 oz/pair)</strong> - Exceptional. Bought three pairs and rotated them. Zero blisters, minimal wear.</li>
        </ul>
        <h3>Insulation & Weather Protection</h3>
        <ul>
          <li><strong>Montbell Superior Down Jacket (8.7 oz)</strong> - Excellent. Perfect warmth-to-weight ratio and surprisingly durable.</li>
          <li><strong>Patagonia Thermal Weight Bottoms (5.4 oz)</strong> - Good. Used less than expected but essential for cold Sierra nights.</li>
          <li><strong>Outdoor Research Helium Rain Jacket (6.3 oz)</strong> - Adequate. Kept me dry in light rain but wetted through in sustained downpours.</li>
        </ul>
        <h2>Footwear: The Most Personal Choice</h2>
        <p>I started with Altra Lone Peak 5.0s but experienced significant foot pain in the first 500 miles. Switching to Brooks Cascadia 16s resolved the issues immediately. This reinforced that shoe recommendations are highly individual—what works for one hiker may be torture for another.</p>
        <p>In total, I went through:</p>
        <ul>
          <li>1 pair of Altra Lone Peaks (500 miles)</li>
          <li>4 pairs of Brooks Cascadia 16s (approximately 550 miles per pair)</li>
        </ul>
        <p>Trail runners were definitely the right choice over traditional hiking boots, offering faster drying times and greater comfort despite less durability.</p>
        <h2>Kitchen System: Simplicity Wins</h2>
        <p>My cooking setup was minimal but perfectly functional:</p>
        <ul>
          <li><strong>BRS-3000T Stove (0.9 oz)</strong> - Exceptional value. Tiny, ultralight, and surprisingly durable.</li>
          <li><strong>TOAKS Titanium 750ml Pot (3.6 oz)</strong> - Excellent. Perfect size for one-pot meals and hot drinks.</li>
          <li><strong>Sea to Summit Long Spoon (0.4 oz)</strong> - Essential for reaching the bottom of freeze-dried meal pouches.</li>
        </ul>
        <p>This simple system allowed me to boil water quickly for breakfast and dinner without unnecessary weight or complexity. I did replace the BRS stove once in Oregon as the flame pattern became uneven after 1,800 miles of use.</p>
        <h2>Water System: Reliability Matters</h2>
        <p>Water treatment is non-negotiable on the PCT, with numerous water sources contaminated with Giardia and other pathogens.</p>
        <ul>
          <li><strong>Sawyer Squeeze Filter (3.0 oz)</strong> - Excellent. Backflushed regularly and it performed flawlessly.</li>
          <li><strong>CNOC Vecto 2L Water Container (2.6 oz)</strong> - Exceptional. The wide opening made collecting from shallow sources much easier than with SmartWater bottles.</li>
          <li><strong>SmartWater Bottles (1.4 oz each)</strong> - Simple and effective for carrying treated water.</li>
        </ul>
        <h2>Electronics: Worth Their Weight</h2>
        <ul>
          <li><strong>iPhone 12 Mini (4.8 oz)</strong> - Essential for navigation via Guthook (now FarOut), photography, and communication.</li>
          <li><strong>Nitecore NB10000 Power Bank (5.3 oz)</strong> - Excellent. Usually provided 3-4 full phone charges between resupply points.</li>
          <li><strong>Petzl Bindi Headlamp (1.2 oz)</strong> - Failed. Too dim and short battery life. Replaced with Black Diamond Spot 350.</li>
        </ul>
        <h2>Luxury Items That Earned Their Keep</h2>
        <p>These items weren't strictly necessary but significantly improved my trail experience:</p>
        <ul>
          <li><strong>Therm-a-Rest Z-Seat (2.0 oz)</strong> - Worth its weight in gold for breaks on wet or cold ground.</li>
          <li><strong>Garmin inReach Mini (3.5 oz)</strong> - Peace of mind for emergency communication and letting family track my progress.</li>
          <li><strong>Kula Cloth (0.4 oz)</strong> - Reduced toilet paper use and environmental impact.</li>
        </ul>
        <h2>What I'd Change for Next Time</h2>
        <p>After 2,650 miles of testing, here's what I'd modify for my next thru-hike:</p>
        <ol>
          <li><strong>Warmer quilt</strong> - I'd opt for the Enlightened Equipment Enigma 10°F instead of the 20°F.</li>
          <li><strong>More durable sleeping pad</strong> - I'd start with the Nemo Tensor Insulated rather than the XLite.</li>
          <li><strong>Better rain gear</strong> - I'd upgrade to a more breathable and durable rain jacket like the Outdoor Research Foray.</li>
          <li><strong>Different underwear</strong> - I'd exclusively use Patagonia briefs from the start.</li>
          <li><strong>Brighter headlamp</strong> - I'd begin with the Black Diamond Spot 350.</li>
          <li><strong>Dedicated camp shoes</strong> - I'd add lightweight flip-flops (2-3 oz) for stream crossings and camp comfort.</li>
        </ol>
        <h2>Final Thoughts</h2>
        <p>The PCT taught me that the perfect gear system is highly personal and constantly evolving. What works for one hiker may be completely wrong for another. The best approach is to start with well-researched choices, remain flexible, and be willing to adapt your system as you learn what works for your body and hiking style.</p>
        <p>The most important gear lesson from 2,650 miles: don't get too precious about your gear choices. At the end of the day, it's just stuff. The trail experience is about the journey, the people, and the personal growth—not having the perfect titanium spork or the lightest tent stakes.</p>
        <p>That said, good gear choices can significantly enhance your comfort, safety, and enjoyment on a long-distance trail. I hope my experiences help other aspiring thru-hikers make informed decisions for their own adventures.</p>
      `,
      image: 'https://images.unsplash.com/photo-1551632436-cbf8dd35adfa?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2000&q=80',
      author: 'Emma Mitchell',
      authorImage: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=100&q=80',
      authorBio: 'Triple Crown thru-hiker and ultralight backpacking specialist.',
      date: 'February 28, 2023',
      location: 'Pacific Crest Trail',
      likes: 356,
      comments: 78,
      tags: ['Thru-Hiking', 'Ultralight Gear', 'PCT', 'Gear Review'],
      relatedStories: [{
        id: 'post1',
        title: 'Winter Ascent of Mount Rainier: Gear That Saved My Life',
        image: 'https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=700&q=80'
      }, {
        id: 'post4',
        title: 'Alpine Photography: The Ultimate Gear Guide',
        image: 'https://images.unsplash.com/photo-1486870591958-9b9d0d1dda99?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=700&q=80'
      }]
    },
    post3: {
      title: 'Desert Survival: Testing Water Filters in the Mojave',
      excerpt: "When water sources are scarce and potentially contaminated, having a reliable filtration system is critical. Here's how 5 popular filters performed.",
      content: `
        <p>In the unforgiving landscape of the Mojave Desert, water is life. When planning a 7-day solo trek through some of its most remote sections, I knew that water management would be my greatest challenge. With sources often miles apart and of questionable quality, I needed absolute confidence in my filtration system.</p>
        <p>Rather than simply trusting marketing claims, I decided to conduct a comprehensive field test of five popular water filters in actual desert conditions. The results were eye-opening and, in some cases, potentially life-saving.</p>
        <h2>The Testing Environment</h2>
        <p>My route through the Mojave included several challenging water sources:</p>
        <ul>
          <li>Stagnant cattle tanks with visible biological contamination</li>
          <li>Silty, sediment-heavy seeps from canyon walls</li>
          <li>Alkaline springs with high mineral content</li>
          <li>A few reliable but heavily used natural springs</li>
        </ul>
        <p>Temperatures during the trek ranged from 95°F (35°C) during the day to 45°F (7°C) at night. These conditions pushed both the filters and my own physical limits to the extreme.</p>
        <h2>The Contenders</h2>
        <p>I selected five popular filtration systems representing different technologies and price points:</p>
        <ol>
          <li><strong>Sawyer Squeeze</strong> - Hollow fiber membrane filter (0.1 micron)</li>
          <li><strong>Katadyn BeFree</strong> - Hollow fiber membrane filter (0.1 micron)</li>
          <li><strong>MSR Guardian</strong> - Hollow fiber membrane with purifier (0.02 micron)</li>
          <li><strong>Platypus GravityWorks</strong> - Hollow fiber membrane filter (0.2 micron)</li>
          <li><strong>LifeStraw Peak Series Squeeze</strong> - Hollow fiber membrane filter (0.2 micron)</li>
        </ol>
        <p>I carried all five systems throughout the journey, using each one multiple times on different water sources to ensure fair testing.</p>
        <h2>Testing Methodology</h2>
        <p>For each water source, I evaluated the filters on several critical criteria:</p>
        <ul>
          <li><strong>Flow Rate</strong> - Measured in liters per minute</li>
          <li><strong>Clogging Resistance</strong> - How quickly flow diminished with silty water</li>
          <li><strong>Field Maintenance</strong> - Ease of cleaning in primitive conditions</li>
          <li><strong>Durability</strong> - Resistance to drops, freezing, and general abuse</li>
          <li><strong>Ease of Use</strong> - Practical usability when dehydrated and exhausted</li>
          <li><strong>Water Quality</strong> - Taste, clarity, and apparent effectiveness</li>
        </ul>
        <p>I also collected water samples before and after filtration for later laboratory analysis to test for bacteria, protozoa, and chemical contaminants (results discussed below).</p>
        <h2>Results: The Good, the Bad, and the Dangerous</h2>
        <h3>Sawyer Squeeze</h3>
        <p><strong>Verdict: Reliable Workhorse</strong></p>
        <p>The Sawyer Squeeze performed admirably across most criteria. Its initial flow rate was excellent (1.7 liters per minute with clean water), though this decreased significantly with silty sources. The backflushing mechanism worked well to restore flow, but required clean water—a precious commodity in the desert.</p>
        <p>The filter's durability was impressive. After an accidental 4-foot drop onto rocks, it continued functioning without issue. The biggest drawback was the included pouches, which developed leaks at the seams by day 3. I switched to compatible SmartWater bottles, which worked perfectly.</p>
        <p>Laboratory analysis showed complete removal of bacteria and protozoa, living up to its specifications.</p>
        <h3>Katadyn BeFree</h3>
        <p><strong>Verdict: Fast But Fragile</strong></p>
        <p>The BeFree started with the fastest flow rate of any tested filter (2.1 liters per minute), making it a joy to use initially. However, it suffered catastrophically when filtering silty water. After just two uses at a sediment-heavy seep, the flow rate dropped to an unusable trickle that could not be restored despite following all cleaning protocols.</p>
        <p>The soft flask was comfortable to squeeze but proved vulnerable to punctures from desert vegetation. By the end of the trip, the flask had developed a slow leak requiring repair with tenacious tape.</p>
        <p>When functioning, filtration effectiveness was excellent according to lab tests, but its rapid decline in challenging conditions makes it hard to recommend for desert environments.</p>
        <h3>MSR Guardian</h3>
        <p><strong>Verdict: Bombproof But Overkill</strong></p>
        <p>The Guardian was the tank of the group—virtually indestructible and unfazed by even the most challenging water sources. Its self-cleaning mechanism worked flawlessly, maintaining a consistent flow rate (1.5 liters per minute) regardless of water quality.</p>
        <p>The purifier component provided peace of mind, with lab tests confirming removal of not just bacteria and protozoa but also viruses—likely unnecessary in North American wilderness but valuable for international travel.</p>
        <p>The downsides were significant, however: weight (22 oz), bulk, and price ($350). For desert backpacking where every ounce matters, these factors make it difficult to justify unless traveling internationally or with a group.</p>
        <h3>Platypus GravityWorks</h3>
        <p><strong>Verdict: Camp Luxury, Trail Liability</strong></p>
        <p>The gravity-fed system was a delight to use in camp, allowing me to set it up and attend to other tasks while water filtered. The 4-liter capacity was perfect for dry camping, providing enough water for dinner, breakfast, and the next day's hike.</p>
        <p>However, the system proved problematic on the trail. The multiple components were cumbersome to deploy for quick water collection, and the dirty bag was difficult to fill from shallow seeps and springs. The filter also clogged quickly with silty water, requiring field cleaning that was more involved than the squeeze systems.</p>
        <p>Filtration effectiveness was excellent according to lab tests, but the system's complexity makes it better suited to base camping than desert trekking.</p>
        <h3>LifeStraw Peak Series Squeeze</h3>
        <p><strong>Verdict: Surprising Performer</strong></p>
        <p>The dark horse of the test, LifeStraw's newer offering impressed me with its thoughtful design. The membrane wiping mechanism effectively restored flow rates without requiring clean backflush water—a significant advantage in the desert.</p>
        <p>Initial flow rates were good (1.5 liters per minute) and remained relatively consistent throughout the trip. The included bottle adapter was compatible with standard threads, offering versatility when the included pouch eventually developed a small leak.</p>
        <p>Laboratory analysis confirmed effective removal of bacteria and protozoa. The filter's relatively low price point ($37) combined with its performance makes it an excellent value.</p>
        <h2>The Critical Failure: Freezing Temperatures</h2>
        <p>On the fourth night, temperatures unexpectedly dropped below freezing. Despite keeping the Sawyer and Katadyn filters in my sleeping bag, the Platypus and LifeStraw were inadvertently left exposed in my pack.</p>
        <p>The next morning, I discovered a critical safety issue: frozen filters can develop micro-fractures invisible to the naked eye, compromising filtration effectiveness without any obvious change in flow rate or water appearance.</p>
        <p>Laboratory analysis later confirmed that the frozen Platypus filter allowed bacteria to pass through, despite looking and functioning normally. This potentially dangerous situation highlights the importance of preventing freezing at all costs—a significant consideration for desert environments where nighttime temperatures can plummet.</p>
        <h2>The Verdict: Which Filter Reigned Supreme?</h2>
        <p>After 7 days and approximately 35 liters of filtered water from various challenging sources, my conclusions are:</p>
        <ol>
          <li><strong>Best Overall for Desert Use: Sawyer Squeeze</strong> - The combination of reliability, field maintainability, and compatibility with standard bottles makes it the safest choice for critical desert applications.</li>
          <li><strong>Most Durable: MSR Guardian</strong> - Unmatched reliability and self-cleaning capability, but with significant weight and cost penalties.</li>
          <li><strong>Best Value: LifeStraw Peak Series Squeeze</strong> - Impressive performance at a reasonable price point, with thoughtful features for field maintenance.</li>
          <li><strong>Best for Base Camping: Platypus GravityWorks</strong> - Convenient for established camps but too cumbersome for efficient trail use.</li>
          <li><strong>Least Recommended for Desert Use: Katadyn BeFree</strong> - Despite its appealing initial performance, its rapid degradation with silty water makes it unsuitable for desert environments.</li>
        </ol>
        <h2>Beyond Filtration: Desert Water Management Lessons</h2>
        <p>This test reinforced several critical lessons about desert water management:</p>
        <ol>
          <li><strong>Redundancy is essential</strong> - Carry backup purification methods (chemical treatment tablets saved me when the Katadyn failed)</li>
          <li><strong>Pre-filtering is crucial</strong> - Using a bandana or dedicated pre-filter dramatically extends filter life in silty conditions</li>
          <li><strong>Protect from freezing at all costs</strong> - A compromised filter that appears functional is more dangerous than no filter at all</li>
          <li><strong>Capacity matters</strong> - The ability to carry 4-6 liters of water is often necessary between desert sources</li>
          <li><strong>Consider weight trade-offs carefully</strong> - A slightly heavier but more reliable filter may be worth it when water sources are questionable</li>
        </ol>
        <h2>Final Thoughts</h2>
        <p>In desert environments, your water filtration system isn't just about convenience—it's a life support system. This test revealed that popular filters vary dramatically in their suitability for these challenging conditions.</p>
        <p>While the Sawyer Squeeze emerged as my top recommendation, the right choice ultimately depends on your specific needs, group size, and risk tolerance. Whatever system you choose, understanding its limitations and proper maintenance is just as important as the filter itself.</p>
        <p>Remember: in the desert, your water system is not the place to compromise on reliability or to save a few ounces. When the next water source is uncertain, having absolute confidence in your filtration system provides peace of mind that's worth its weight in gold—or in this case, worth its weight in water.</p>
      `,
      image: 'https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2000&q=80',
      author: 'Carlos Rodriguez',
      authorImage: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=100&q=80',
      authorBio: 'Desert hiking specialist and water systems expert with experience in extreme environments.',
      date: 'February 15, 2023',
      location: 'Mojave Desert, CA',
      likes: 189,
      comments: 34,
      tags: ['Water Filtration', 'Desert Hiking', 'Survival', 'Gear Testing'],
      relatedStories: [{
        id: 'post1',
        title: 'Winter Ascent of Mount Rainier: Gear That Saved My Life',
        image: 'https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=700&q=80'
      }, {
        id: 'post6',
        title: 'How My Tent Survived a Category 3 Storm in Iceland',
        image: 'https://images.unsplash.com/photo-1504280390367-361c6d9f38f4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=700&q=80'
      }]
    }
  };
  // If story doesn't exist, provide a default
  const story = stories[postId] || {
    title: 'Story Not Found',
    excerpt: 'The story you are looking for does not exist or has been moved.',
    content: '<p>The story you are looking for does not exist or has been moved.</p>',
    image: 'https://images.unsplash.com/photo-1535392432937-a27c36ec07b5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2000&q=80',
    author: '',
    authorImage: '',
    authorBio: '',
    date: '',
    location: '',
    likes: 0,
    comments: 0,
    tags: [],
    relatedStories: []
  };
  // Function to handle like button click
  const handleLike = () => {
    // In a real app, this would update a database
    console.log('Liked post:', postId);
  };
  return <div className="w-full bg-earth-dark">
      {/* Hero Section */}
      <section className="relative pt-20 pb-12 bg-carbon-black">
        <div className="container mx-auto px-4">
          <Link to="/community" className="inline-flex items-center text-sand-light hover:text-outdoor-orange mb-6">
            <ArrowLeft size={16} className="mr-2" />
            Back to Base Camp
          </Link>
          <div className="max-w-4xl">
            <h1 className="font-display text-4xl md:text-6xl mb-4">
              {story.title}
            </h1>
            <p className="text-xl text-gray-300 mb-6">{story.excerpt}</p>
            <div className="flex items-center justify-between">
              <div className="flex items-center">
                {story.authorImage && <img src={story.authorImage} alt={story.author} className="h-10 w-10 rounded-full object-cover mr-3" />}
                <div>
                  <div className="font-bold">{story.author}</div>
                  <div className="flex items-center text-sm text-gray-400">
                    <Calendar size={14} className="mr-1" />
                    <span className="mr-3">{story.date}</span>
                    {story.location && <>
                        <MapPin size={14} className="mr-1" />
                        <span>{story.location}</span>
                      </>}
                  </div>
                </div>
              </div>
              <div className="flex space-x-3">
                <button className="p-2 rounded-full hover:bg-earth-dark transition-colors">
                  <Bookmark size={20} />
                </button>
                <button className="p-2 rounded-full hover:bg-earth-dark transition-colors">
                  <Share2 size={20} />
                </button>
              </div>
            </div>
          </div>
        </div>
      </section>
      {/* Story Hero Image */}
      <div className="w-full h-[50vh] relative">
        <img src={story.image} alt={story.title} className="w-full h-full object-cover" />
      </div>
      {/* Story Content */}
      <section className="py-16">
        <div className="container mx-auto px-4">
          <div className="flex flex-col lg:flex-row gap-12">
            {/* Main Content */}
            <div className="lg:w-2/3">
              <article className="prose prose-lg prose-invert max-w-none">
                <div dangerouslySetInnerHTML={{
                __html: story.content
              }} />
              </article>
              <div className="mt-12 pt-8 border-t border-gray-700">
                <div className="flex flex-wrap gap-2 mb-8">
                  <span className="text-gray-400 flex items-center mr-2">
                    <Tag size={16} className="mr-1" />
                    Tags:
                  </span>
                  {story.tags.map(tag => <a key={tag} href={`/tags/${tag.toLowerCase().replace(/\s+/g, '-')}`} className="bg-earth-dark hover:bg-outdoor-orange text-white px-3 py-1 rounded-full transition-colors text-sm">
                      #{tag}
                    </a>)}
                </div>
                <div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
                  <div className="flex items-center space-x-4">
                    <button onClick={handleLike} className="flex items-center space-x-2 bg-earth-dark hover:bg-outdoor-orange px-4 py-2 rounded transition-colors">
                      <ThumbsUp size={18} />
                      <span>{story.likes}</span>
                    </button>
                    <button className="flex items-center space-x-2 bg-earth-dark hover:bg-outdoor-orange px-4 py-2 rounded transition-colors">
                      <MessageCircle size={18} />
                      <span>{story.comments}</span>
                    </button>
                    <button className="flex items-center space-x-2 bg-earth-dark hover:bg-outdoor-orange px-4 py-2 rounded transition-colors">
                      <Share2 size={18} />
                      <span>Share</span>
                    </button>
                  </div>
                  <button className="flex items-center justify-center space-x-2 bg-outdoor-orange hover:bg-climbing-red px-4 py-2 rounded transition-colors">
                    <Bookmark size={18} />
                    <span>Save Story</span>
                  </button>
                </div>
              </div>
              {/* Comments Section Placeholder */}
              <div className="mt-12">
                <h3 className="font-display text-2xl mb-6">
                  COMMENTS ({story.comments})
                </h3>
                <div className="bg-carbon-black p-6 rounded-lg">
                  <textarea placeholder="Share your thoughts..." className="w-full bg-earth-dark border border-gray-700 rounded-md px-4 py-3 text-sand-light focus:outline-none focus:border-outdoor-orange" rows={4}></textarea>
                  <div className="mt-4 flex justify-end">
                    <button className="bg-outdoor-orange hover:bg-climbing-red text-white font-display px-6 py-2 rounded transition-colors">
                      POST COMMENT
                    </button>
                  </div>
                </div>
                {/* Sample Comments */}
                <div className="mt-8 space-y-6">
                  <div className="bg-carbon-black p-6 rounded-lg">
                    <div className="flex items-center mb-4">
                      <img src="https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=100&q=80" alt="User" className="h-10 w-10 rounded-full object-cover mr-3" />
                      <div>
                        <div className="font-bold">Marcus Berg</div>
                        <div className="text-sm text-gray-400">2 days ago</div>
                      </div>
                    </div>
                    <p className="text-gray-300">
                      This is incredibly detailed and helpful! I've been using
                      the Sawyer Squeeze for years but never realized how
                      vulnerable it is to freezing. Going to be much more
                      careful on my upcoming trip.
                    </p>
                  </div>
                  <div className="bg-carbon-black p-6 rounded-lg">
                    <div className="flex items-center mb-4">
                      <img src="https://images.unsplash.com/photo-1544005313-94ddf0286df2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=100&q=80" alt="User" className="h-10 w-10 rounded-full object-cover mr-3" />
                      <div>
                        <div className="font-bold">Sarah Kim</div>
                        <div className="text-sm text-gray-400">1 day ago</div>
                      </div>
                    </div>
                    <p className="text-gray-300">
                      I had the exact same experience with the BeFree in the
                      Grand Canyon last summer. Started great but clogged beyond
                      recovery after just one silty water source. Ended up
                      having to borrow my hiking partner's filter for the rest
                      of the trip.
                    </p>
                  </div>
                </div>
              </div>
            </div>
            {/* Sidebar */}
            <div className="lg:w-1/3">
              <div className="sticky top-24">
                {/* Author Bio */}
                <div className="bg-carbon-black p-6 rounded-lg mb-8">
                  <h3 className="font-display text-xl mb-4">
                    ABOUT THE AUTHOR
                  </h3>
                  <div className="flex items-center mb-4">
                    {story.authorImage && <img src={story.authorImage} alt={story.author} className="h-16 w-16 rounded-full object-cover mr-4" />}
                    <h4 className="font-bold text-lg">{story.author}</h4>
                  </div>
                  <p className="text-gray-300 mb-4">{story.authorBio}</p>
                  <Link to={`/community/author/${story.author?.toLowerCase().replace(/\s+/g, '-')}`} className="text-outdoor-orange hover:underline inline-flex items-center">
                    View Profile
                    <ArrowRight size={16} className="ml-1" />
                  </Link>
                </div>
                {/* Related Stories */}
                {story.relatedStories?.length > 0 && <div className="bg-carbon-black rounded-lg p-6">
                    <h3 className="font-display text-xl mb-4">
                      RELATED STORIES
                    </h3>
                    <div className="space-y-4">
                      {story.relatedStories.map(related => <Link key={related.id} to={`/community/post/${related.id}`} className="flex group">
                          <img src={related.image} alt={related.title} className="h-16 w-16 object-cover rounded mr-3" />
                          <div>
                            <h4 className="font-bold group-hover:text-outdoor-orange transition-colors">
                              {related.title}
                            </h4>
                            <div className="flex items-center text-outdoor-orange mt-1">
                              <span className="text-sm">Read Story</span>
                              <ArrowRight size={14} className="ml-1 transition-transform group-hover:translate-x-1" />
                            </div>
                          </div>
                        </Link>)}
                    </div>
                  </div>}
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>;
}